package com.five.api.system;

import com.five.pojo.Menu;
import com.five.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(name = "user-service", contextId = "menuServiceAPI")
public interface MenuServiceAPI {

    @PostMapping("/queryPage")
    Result queryPage(@RequestBody Menu menu);

    @PostMapping("/deleteById/{id}")
    Result deleteById(@PathVariable("id") Long id);

    @PostMapping("/deleteBatch")
    Result deleteBatch(@RequestBody List<Long> ids);

    @PostMapping("/menuTree")
    Result queryMenuTree();

    @PostMapping("/queryCountByParent")
    Result queryCountByParent();

    @PostMapping("/queryCountByParentId/{parentId}")
    Result queryCountByParentId(@PathVariable("parentId") Long parentId);

    @PostMapping("/save")
    Result save(@RequestBody Menu menu);

    @PostMapping("/tree")
    Result tree();

    @PostMapping("/getOwnMenus/{id}")
    Result getOwnMenus(@PathVariable("id") Long id);

}
